Type errors ( such as an attempt to apply the + + increment operator to a boolean variable in Java ) and undeclared variable errors are sometimes considered to be syntax errors when they are detected at compile-time.
2.
Type errors and undeclared variable errors are sometimes considered to be syntax errors when they are detected at compile-time ( which is usually the case when compiling strongly-typed languages ), though it is common to classify these kinds of error as semantic errors instead.